package com.sikaryofficial.backend.domain.dto;

import com.sikaryofficial.backend.constant.ActivityStatusEnum;
import com.sikaryofficial.backend.constant.ActivityTypeEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.util.Objects;

/**
 * @author : qinjinyuan
 * @desc : 奖品活动出参
 * @date : 2023/11/04 10:27
 */
@Getter
@Setter
@ToString
@ApiModel(value = "奖品活动出参", description = "奖品活动出参")
public class PrizeActivityDTO {

    @ApiModelProperty(value = "奖品ID")
    private Long prizeId;
    @ApiModelProperty(value = "活动ID")
    private Long activityId;
    @ApiModelProperty(value = "活动类型")
    private Integer activityType;
    @ApiModelProperty(value = "活动类型描述")
    private String activityTypeDesc;
    @ApiModelProperty(value = "品牌")
    private String brand;
    @ApiModelProperty(value = "型号")
    private String model;
    @ApiModelProperty(value = "奖品图片")
    private String prizeImg;
    @ApiModelProperty(value = "奖品名称")
    private String prizeName;
    @ApiModelProperty(value = "活动状态1-可预约 ;2-活动进行中 ;3-活动结束或下架")
    private Integer activityStatus;
    @ApiModelProperty(value = "活动状态描述")
    private String activityStatusDesc;

    public String getActivityTypeDesc() {
        if (Objects.isNull(activityType)) {
            return null;
        }
        if (Objects.nonNull(ActivityTypeEnum.getNameByCode(activityType))) {
            return ActivityTypeEnum.getNameByCode(activityType).getName();
        }
        return null;
    }

    public String getActivityStatusDesc() {
        if (Objects.isNull(activityStatus)) {
            return null;
        }
        if (Objects.nonNull(ActivityStatusEnum.getNameByCode(activityStatus))) {
            return ActivityStatusEnum.getNameByCode(activityStatus).getName();
        }
        return null;
    }

}
